﻿using Aliphant.ChatAI.Utility;
using Newtonsoft.Json.Linq;

namespace Aliphant.ChatAI.ChatProxys
{
    public class QwenChat : ChatAIBase
    {
        public QwenChat(string filePath) : base(filePath) { }

        public QwenChat(string filePath, string chatPath) : base(filePath) { }

        protected override JObject CreateRequestBody()
        {
            string fileName = Path.Combine(filePath, "request.json");

            var res = JsonHelper.ReadJsonFile(fileName, out string jsonStr);
            if (!res)
            {
                jsonStr = @"{
  'model': 'deepseek-chat',
  'frequency_penalty': 0,
  'max_tokens': 2048,
  'presence_penalty': 0,
  'response_format': {
    'type': 'text'
  },
  'stop': null,
  'stream': true,
  'stream_options': null,
  'temperature': 1,
  'top_p': 1,
  'tools': null,
  'tool_choice': 'none',
  'logprobs': false,
  'top_logprobs': null
}";
            }

            return JObject.Parse(jsonStr);
        }

        protected override void SendAnswer(string cnt, string rcnt, string? line)
        {

        }
    }
}
